import { prompt } from 'inquirer'
import config from "../config";
import { red, green } from 'chalk'
import LanguageInfo from "../modules/LanguageInfo";

/**
 * 获取选取语言的模板
 * @returns 
 */
export default function (): Promise<LanguageInfo> {
    return new Promise((resolve, reject) => {
        prompt(config.languageList).then(({ languageInfo }) => {
            // console.log(green('你选择的语言:\n'), '****', red(languageInfo.languageName))
            resolve(languageInfo)
        }).catch((error) => {
            reject(error)
        })
    })
}